package com.xhwl.logistics.controller;

import com.alibaba.fastjson.JSON;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.logistics.bo.VehicleAccessRecordRealtimeBO;
import com.xhwl.logistics.bo.input.QueryVehicleAccessRecordRealtimeBO;
import com.xhwl.logistics.service.business.VehicleAccessRecordRealtimeBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;

//@RestController
public class VehicleAccessRecordRealtimeController {

    @Autowired
    private VehicleAccessRecordRealtimeBusinessService vehicleAccessRecordRealtimeBusinessService;

    @PostMapping("/access-record/realtime")//暂时只是用于自己测试，其实现主要暴露给open层调用
    public ResultJson<String> accessRecordRealtime(Integer projectId, String parkingLotName) {
        QueryVehicleAccessRecordRealtimeBO queryVehicleAccessRecordRealtimeBO = new QueryVehicleAccessRecordRealtimeBO();
        queryVehicleAccessRecordRealtimeBO.setProjectId(projectId);
        queryVehicleAccessRecordRealtimeBO.setParkingLotName(parkingLotName);
        VehicleAccessRecordRealtimeBO vehicleAccessRecordRealtimeBO = vehicleAccessRecordRealtimeBusinessService.queryAccessRecordRealtime(queryVehicleAccessRecordRealtimeBO);
        return ResultJson.successWithResult(JSON.toJSONString(vehicleAccessRecordRealtimeBO));
    }

}
